﻿using System;
using BO.Infrastructure.StaticData;
using BO.Infrastructure.Utils;
using BO.News;
using BO.Video;

namespace GUI.Pages.Video
{
    public partial class Index : System.Web.UI.Page
    {
        private const int Top = 16;

        protected void Page_Load(object sender, EventArgs e)
        {

            ctrHighlightVideo.Visible = ctrHighlightVideo.DataBind(
                VideoBO.GetVideoByMode(top: 1, mode: DefinedConstants.Video.Mode.NoiBat),
                VideoBO.GetNewestVideo(top: Top)
                );

            #region Title/MetaData
            var mtaCategory = NewsBO.GetInstance().GetCategoryMetaData(-1);
            if (mtaCategory != null)
            {
                PresentationUtils.AddMeta(Page, DefinedConstants.MetaAttributes.Description.Id,
                                          DefinedConstants.MetaAttributes.Description.Name, mtaCategory.Description);
                PresentationUtils.AddMeta(Page, DefinedConstants.MetaAttributes.Keywords.Id,
                                          DefinedConstants.MetaAttributes.Keywords.Name, mtaCategory.Keywords);
                PresentationUtils.AddMeta(Page, DefinedConstants.MetaAttributes.NewsKeywords.Id,
                                          DefinedConstants.MetaAttributes.NewsKeywords.Name, mtaCategory.Keywords);

                Page.Header.Title = string.Format("{0} | Soha.vn", mtaCategory.Title);
            }
            #endregion
        }
    }
}